<header>
<?php 
switch($adc->getViewObject())
{
	case 'AdLatest':
	?>
	<h3 class="float-left title"><a href="<?php echo $ad->getLink(); ?>" itemprop="url"><span itemprop="name"><?php echo $txt->truncate($ad->getMakeTitle(), 36, '', '', ''); ?></span></a></h3>
	<div class="clear"></div>
	<?php
	break;
	case 'AdGallery':
	?>
	<h3 class="title"><a href="<?php echo $ad->getLink(); ?>" itemprop="url"><span itemprop="name"><?php echo $txt->truncate($ad->getMakeTitle(), 36, '', '', ''); ?></span></a></h3>
	<?php
	break;
	case 'AdEdit':
	?>
	<h3 class="title"><a href="<?php echo $ad->getLink(); ?>" itemprop="url"><span itemprop="name"><?php echo $txt->truncate($ad->getTitle(), 32, '', '', ''); ?></span></a></h3>
	<p class="publish-info">
	<?php 
	if($ad->getActive() == 0)
	{ 
		echo ucfirst($txt->getWord('new')).'&nbsp;&nbsp;';
		if($ad->getDateModified() != '0000-00-00 00:00:00')
		{ echo '|&nbsp;&nbsp;'.ucfirst($txt->getWord('last_modified')).':&nbsp;&nbsp;'.$ad->getDateModified('d.m.Y').'&nbsp;&nbsp;'; }
		else
		{
			if($ad->getDateCreated() != '0000-00-00 00:00:00')
			{ echo '|&nbsp;&nbsp;'.ucfirst($txt->getWord('created')).':&nbsp;&nbsp;'.$ad->getDateCreated('d.m.Y').'&nbsp;&nbsp;'; }
		}
	}
	else
	{
		if($ad->getIsCompleted() > 0)
		{ echo ucfirst($txt->truncate($ad->getIsBoughtText(), 10, '', '', '')).'&nbsp;&nbsp;'; }
		else
		{ 
			if(strtotime($ad->getDateActiveEnd()) > time())
			{ echo ucfirst($txt->getWord('published')).': '.$ad->getDateActiveStart('d.m.Y H:i').'&nbsp;&nbsp;'; }
			//echo $ad->formatDateTime($ad->getDateActiveStart(), 'd.m.Y').'&nbsp;'; 
			if($ad->getArchived() > 0)
			{ echo ucfirst($txt->getWord('archived')).'&nbsp;&nbsp;'; }

			if($ad->getDateActiveEnd() != '0000-00-00 00:00:00')
			{ 
				$nextWeek = time() + (7 * 24 * 60 * 60)*2;
				
				echo '<span';
				if(strtotime($ad->getDateActiveEnd()) < $nextWeek) { echo ' class="red"'; }
				echo '>';
				
				if(strtotime($ad->getDateActiveEnd()) < time())
				{ echo ucfirst($txt->getWord('expired')).'&nbsp;&nbsp;'; }
				else
				{ echo '|&nbsp;&nbsp;'.ucfirst($txt->getWord('expires')).':&nbsp;&nbsp;'; }
				echo $ad->formatDateTime($ad->getDateActiveEnd(), 'd.m.y').'&nbsp;&nbsp;'; 
				echo '</span>';
			}
		}
	}
	echo '|&nbsp;&nbsp;'.ucfirst($txt->getWord('code')).':&nbsp;&nbsp;'.$ad->getId();
	?>
	</p>
	<?php
	break;
	default:
	?>
	<h3 class="float-left title grid_4 alpha"><a href="<?php echo $ad->getLink(); ?>" itemprop="url"><span itemprop="name"><?php echo $txt->truncate($ad->getTitle(), 32, '', '', ''); ?></span></a></h3>
	<?php echo '<time class="float-right grid_1" pubdate datetime="'.$ad->getDateModified('Y-m-d').'">'.$ad->getDateModified('d.m.Y').'</time>'; ?>
	<?php
	break;
}
?>
</header>
<div class="clear"></div>